<template>
  <!-- 整体区域 -->
  <el-container class="home-contain">
    <!-- 头部区域 -->
    <el-header>
      <!-- 头像标题区域 -->

      <Head></Head>
    </el-header>

    <el-container>
      <!-- 侧边导航栏 -->
      <el-aside width="auto">
        <!-- 折叠按钮 -->
        <!-- <el-button type="primary" icon="el-icon-edit"></el-button> -->
        <div class="toggle-button" @click="toggleCollapse">|&nbsp;|&nbsp;|</div>
        <Aside ref="asideMenu"></Aside>
      </el-aside>
      <!-- 右边主体区域 -->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// 导入head组件
import Head from '@/components/head/Head.vue'
// 导入aside组件
import Aside from '@/components/aside/Aside.vue'
export default {
  name: 'Home',
  components: {
    Head,
    Aside
  },
  methods: {
    toggleCollapse() {
      this.$refs.asideMenu.isCollapse = !this.$refs.asideMenu.isCollapse
    }
  }
}
</script>

<style lang="less" scoped>
.home-contain {
  height: 100%;
  .el-header {
    background: #373d41;
    padding-left: 0;
  }
  .el-aside {
    background: #333744;
  }
  .el-main {
    background: #eaedf1;
  }
  .toggle-button {
    background: #4a5064;
    font-size: 12px;
    line-height: 24px;
    color: #fff;
    text-align: center;
    cursor: pointer;
  }
}
</style>